package com.jec.module.sysconfig.service.configor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Component;

import com.jec.module.sysconfig.dao.TonglingRepository;
import com.jec.module.sysconfig.entity.TonglingConfig;
import com.jec.module.sysconfig.service.convertor.Convertor;
import com.jec.module.sysconfig.service.convertor.TonglingConvertor;

@Component
public class TonglingConfigor extends BaseConfigor<TonglingConfig> {
	
	@Autowired
	private TonglingRepository tonglingRepository;
	
	@Autowired 
	private TonglingConvertor tonglingConvertor;

	public TonglingConfigor() {
		logKey = "通令";
	}
	
	@Override
	protected JpaRepository<TonglingConfig, Integer> getRepository() {
		return tonglingRepository;
	}
	
	@Override
	protected Convertor<TonglingConfig> getConvertor() {
		return tonglingConvertor;
	}

	@Override
	public boolean hasConfigOnNetunit(int netunit) {
		return !tonglingRepository.findAllByNetunit(netunit).isEmpty();
	}

}
